

def decorator(target):

    def wrapper():
        print 'Calling function "%s"' % target.__name__
        return target()

        # Since the wrapper is replacing the target function, assigning an attribute to the target function won't do anything.
        # We need to assign it to the *wrapper function*.
    wrapper.attribute = 1
    return wrapper

@decorator
def target():
    print 'I am the target function'


target()
    

